package mmc.gl.shader;

import static org.lwjgl.opengl.GL20.*;
import mmc.resource.Texture;

public class CellShader extends ShaderProgram {
	
	Shader fs = new Shader("mmc/gl/shader/CellShader.fs");
	Shader vs = new Shader("mmc/gl/shader/CellShader.vs");
	
	Uniform u_texture;
	
	public CellShader(){
		attach(fs);
		attach(vs);
		link();
		
		u_texture = new Uniform("texture");
	}
	
	private static CellShader instance;
	
	public void setTexture(Texture t){
		glUniform1i(u_texture.location, t.id);
	}
	
	public static CellShader get(){
		if(instance==null)
			instance = new CellShader();
		
		return instance;
	}
}
